function TimestampToStr( timestamp, format )
{
	// default to display all
	if( format == null ) format = "all";
	
	var my_date = new Date( parseInt(timestamp)*1000 );
	var ret = "";
	
	// only process this for all or date
	if( format == "all" || format == "date" )
	{
		// get year
		ret = ret + my_date.getFullYear();
		
		// get month
		ret = ret + "/" + ConverIntegerToTwoDigit(my_date.getMonth()+1);

		// get day
		ret = ret + "/" + ConverIntegerToTwoDigit(my_date.getDate());
	}
	
	// for all need a space inside
	if( format == "all" ) ret = ret + " ";
	
	// only process this for all or time
	if( format == "all" || format == "time" )
	{
		// get hour
		ret = ret + ConverIntegerToTwoDigit(my_date.getHours());

		// get minute
		ret = ret + ":" + ConverIntegerToTwoDigit(my_date.getMinutes());
	
		// get second
		ret = ret + ":" + ConverIntegerToTwoDigit(my_date.getSeconds());
	}

	return ret;
}

function StrToTimestamp(date, time) {
	// get date
	date = date.split(/[-\/]/);
	
	// get time
	if( time == null ) time = "00:00:00"
	time.split(/:/);

	// convert to timestamp
	d = new Date;
	d.setFullYear(date[0]);
	d.setMonth(date[1]-1);
	d.setDate(date[2]);
	d.setHours(time[0]);
	d.setMinutes(time[1]);
	d.setSeconds(time[2]);
	timestamp = Math.floor(d.getTime()/1000);
	return timestamp;
}

function trim( in_str )
{
	if( in_str==null || in_str=="" ) return "";
	else return in_str.replace( /^\s+|\s+$/g, "" );
}
